/**
 * mes模块的接口
 */

import type { User } from './auth_interface';
import type { MaterialBatch } from './wms_interface';

// 物料类别
export interface MaterialType {
  id?: number; // 主键
  name?: string;
  enabled?: boolean; // 是否可用
  sort?: number;
  materialNumber?: number;
}

// 物料
export interface Material {
  materialType?: MaterialType;
  materialTypeId?: number;
  id?: string; // 主键
  name?: string;
  enabled?: boolean; // 是否可用
  inventory?: number;
}

// 汽车品牌
export interface CarBrand {
  id?: number; // 主键
  name?: string;
  enabled?: boolean; // 是否可用
}

// 车型
export interface CarModel {
  id?: string; // 主键
  carBrand?: CarBrand;
  carBrandId?: number;
  name?: string;
  type?: number;
  stopProduction?: boolean;
  enabled?: boolean; // 是否可用
}
// 车型配置
export interface CarModelConfig {
  id?: string; // 主键
  carModel?: CarModel;
  name?: string;
  code?: string;
  stopProduction?: boolean;
  enabled?: boolean; // 是否可用
  carModelId?: string;
  carModelName?: string;
}
//汽车工艺
export interface CarTechnology {
  id?: string; // 主键
  carModelConfig?: CarModelConfig;
  name?: string;
  enabled?: boolean; // 是否可用
  carTechnologyDetails?: CarTechnologyDetail[]; //工艺详情列表
  carModelConfigId?: string;
  carModelConfigName?: string;
}
//汽车工艺详情
export interface CarTechnologyDetail {
  id?: string; // 主键
  materialId?: string;
  carTechnology?: CarTechnology;
  carTechnologyId?: string;
  material?: Material; //物料
  quantity?: number; //数量
  sort?: number; //排序
}
//生产订单
export interface ProductionOrder {
  id?: string; // 主键
  carModelConfig?: CarModelConfig;
  carTechnology?: CarTechnology;
  carTechnologyId?: string;
  steps?: ProductionOrderStep[]; //步骤集合
  vin?: string;
  status?: string;
  auditResult?: boolean;
  auditor?: User;
}
//生产订单步骤
export interface ProductionOrderStep {
  id?: string; // 主键
  productionOrder?: ProductionOrder;
  carTechnologyDetail?: CarTechnologyDetail;
  materialBatch?: MaterialBatch;
  materialBatchId?: string;
  actualQuantity?: number;
  operator?: User;
  status?: string;
  auditor?: User;
  auditResult?: boolean;
  auditNote?: string;
  materialName?: string; //物料名
}
